/* **********************************************************************************
*
* Copyright (c) Microsoft Corporation. All rights reserved.
*
* This source code is subject to terms and conditions of the Shared Source License
* for DSL Editor PowerToy. A copy of the license can be found in the License.htm file
* at the root of this distribution. If you can not locate the Shared Source License
* for DSL Editor PowerToy, please obtain a copy from: http://www.codeplex.com/dsltreegrideditor/Project/License.aspx.
* By using this source code in any fashion, you are agreeing to be bound by
* the terms of the Shared Source License for DSL Editor PowerToy.
*
* You must not remove this notice, or any other, from this software.
*
* **********************************************************************************/
using System;
using System.Collections.Generic;
using System.Text;

namespace DslEditorPowerToy.Controls.Editors.Special.DomainModelTreeGrid.Data
{
    internal interface IDomainElementContainer : IDomainElement
    {
        /// <summary>
        /// Adds new child element to parent
        /// </summary>
        /// <param name="name"></param>
        /// <param name="validationError"></param>
        /// <returns>true if successful, false otherwise</returns>
        bool AddChildElement(string name, out string validationError);
        /// <summary>
        /// Removes an existing child element from parent
        /// </summary>
        /// <param name="name"></param>
        /// <returns>true if successful, false otherwise</returns>
        bool RemoveChildElement(int index);
        /// <summary>
        /// Moves a child element in parent collection
        /// </summary>
        /// <returns>true if successful, false otherwise</returns>
        bool MoveChildElement(int fromIndex, int toIndex);
        /// <summary>
        /// Raised when child element added
        /// </summary>
        event ChildElementAddedEventHandler ChildElementAdded;
        /// <summary>
        /// Raised when child element removed from parent collection
        /// </summary>
        event ChildElementRemovedEventHandler ChildElementRemoved;
        /// <summary>
        /// Raised when child element moved within parent collection
        /// </summary>
        event ChildElementMovedEventHandler ChildElementMoved;
        /// <summary>
        /// Gets the children of the parent collection
        /// </summary>
        DomainElementCollection<IDomainElement> Children
        {
            get;
        }
    }
}
